<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title>借款申请管理</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/meta.jsp"%>
<script type="text/javascript">
function borrows(){
	  this.id;
	  this.title;
	  this.amount;
	  this.rePayAmount;
}
function closeWindow(id, title, amount, rePayAmount){
	  var borrow = new borrows();
	  borrow.id = id;
	  borrow.title = title;
	  borrow.amount = amount;
	  borrow.rePayAmount = rePayAmount;
	  if (navigator.userAgent.indexOf("MSIE")>0){//IE判断
			window.returnValue = borrow;
			window.close();
	  }else{
			window.parent.close();
			window.parent.opener.returnAction(borrow);
	  }
}

function view(id){
  window.showModalDialog("${ctx}/borrow/view.do?model.id=" + id, null, "dialogWidth=800px;dialogHeight=555px;resizable: Yes;");
}

</script>
</head>
<body>
<div class="x-panel">
<div class="x-panel-header" >出纳已付款的借款单</div>
<div class="x-toolbar">
  <table width="99%">
        <tr>
        <s:form action="showIndex" theme="simple" id="form1">        
          <td width="220">摘要：<s:textfield name="model.title" cssStyle="width:180px;" /></td>
          <td width="600">开始日期：<input id="startDate" name="startDate" size="11"  value='${startDate}' onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"  readonly="readonly"/>
        	   &nbsp;结束日期：<input id="endDate" name="endDate" size="11" value='${endDate}' onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startDate\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"  readonly="readonly"/>
        	<s:submit value="查询" cssClass="button" cssStyle="width:40px;"></s:submit>
           </td>
        </s:form>
      </table>
</div>
<div class="x-panel-body">
<ec:table items="items" var="item" retrieveRowsCallback="limit" sortRowsCallback="limit" 
	    action="showIndex.do"
		useAjax="true" doPreload="false"
		maxRowsExported="10000000" 
		pageSizeList="15,50,100" 
		editable="false" 
		sortable="false"	
		rowsDisplayed="15"	
		generateScript="true"	
		resizeColWidth="true"	
		classic="false"	
		width="100%" 	
		height="400px"	
		minHeight="400"
		toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row ondblclick="closeWindow('${item.id}','${item.title}','${item.amount}', '${item.rePayAmount}')" >
	    <ec:column width="30" property="_s" title="No." value="${GLOBALROWCOUNT}" sortable="false" style="text-align:center"/>
		<ec:column width="130" property="title" title="摘要" ellipsis="true"/>
	    <ec:column width="100" property="borrower.dept.name" title="部门" style="text-align:center" ellipsis="true"/>
	    <ec:column width="60" property="borrower.name" title="借款人" style="text-align:center"/>	
		<ec:column width="70" property="createDate" title="借款时间" style="text-align:center" cell="date"/>
		<ec:column width="70" property="amount" title="借款金额" style="text-align:right" format="#####0.00" cell="number"/>	
		<ec:column width="75" property="_dept" title="部门审批" style="text-align:center">
		  <s:if test="#attr.item.deptAudStatus == 0"><font color="#999999">未审批</font></s:if>
		  <s:if test="#attr.item.deptAudStatus == 1"><font color="#000000">待审批</font></s:if>
		  <s:if test="#attr.item.deptAudStatus == 2"><font color="green">已通过</font></s:if>
		  <s:if test="#attr.item.deptAudStatus == 3"><font color="red">未通过</font> </s:if>
		</ec:column>	
		<ec:column width="75" property="_finance" title="财务审核" style="text-align:center">
		  <s:if test="#attr.item.finaAudStatus == 0"><font color="#999999">未审核</font></s:if>
		  <s:if test="#attr.item.finaAudStatus == 1"><font color="#000000">待审核</font></s:if>
		  <s:if test="#attr.item.finaAudStatus == 2"><font color="green">已通过</font></s:if>
		  <s:if test="#attr.item.finaAudStatus == 3"><font color="red">未通过</font> </s:if>
		</ec:column>
		<ec:column width="65" property="_payStatus" title="出纳付款" style="text-align:center">
		  <s:if test="#attr.item.payStatus == 0"><font color="#999999">未付款</font></s:if>
		  <s:if test="#attr.item.payStatus == 1"><font color="green">已付款</font></s:if>
		</ec:column>
        <ec:column width="65" property="_rePayAmount" title="还款金额" style="text-align:right" format="#####0.00" cell="number">
            <c:if test="${item.rePayAmount > 0 }">
              ${item.rePayAmount} 
            </c:if>
        </ec:column>												
		<ec:column width="45" property="_0" title="操作" style="text-align:center" sortable="false">
		     <a href="#" onclick="view('${item.id}')">查看</a>
		</ec:column>
	</ec:row>
</ec:table>
</div>
</div>

</body>
</html>